<%@page pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/common/taglibs-include.jsp"%>
<ul class="submenu" style="${isChecked ? "display:block" : "display:none"}">
	<c:forEach items="${submenus}" var="submenu">
		<c:set var="isChecked" value="${sys:checked(level, currModule, submenu.moduleCode)}" scope="request"/>
		<c:choose>
            <c:when test="${isChecked && submenu.hasSub}">
                <li class="open">
            </c:when>
            <c:when test="${isChecked && !submenu.hasSub}">
                <li class="active">
            </c:when>
            <c:otherwise><li></c:otherwise>
        </c:choose>
		<a onclick="choiceSubmenu(this)" href="<c:if test="${submenu.hasSub}">javascript:void(0);</c:if><c:if test="${!submenu.hasSub}"><c:url value="${submenu.moduleUrl}"/></c:if>"> 
			<i class="menu-icon fa fa-caret-right"></i>${submenu.moduleName}
		</a> <b class="arrow"></b>
		<c:if test="${submenu.hasSub}">
            <c:set var="submenus" value="${submenu.childs}" scope="request"/>
            <c:set var="level" value="${level+1}" scope="request"/>
            <c:import url="/WEB-INF/views/decorators/submenu.jsp"/>
        </c:if>
		
		</li>
		
	</c:forEach>
	<c:set var="level" value="${level-1}" scope="request"/>
</ul>
